package com.czh.rdm.chat_2

class AlienSpecies(
    val name: String,
    val eyes: Int,
    val hands: Int,
    val legs: Int
) {
    fun describe() =
        "$name with $eyes eyes, " +
                "$hands hands and $legs legs"

    override fun toString(): String {
        return describe()
    }
}

fun sum(vararg numbers: Int): Int {
    println(numbers.javaClass.kotlin)
    return numbers.sum()
}

fun main() {
    val kevin =
        AlienSpecies("Zigerion", 2, 2, 2)
    val mortyJr =
        AlienSpecies("Gazorpian", 2, 6, 2)
    println(kevin)
    println(mortyJr)
    println(kevin.name)
    println("-------------")
    println(sum(1,2,3,4,5,6,7,8,9))
    val array = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 1)
    println(array)
    println(array.distinct())
    println("--------")
    val map = mapOf(1 to "one", 2 to "two", 3 to "three")
    map.forEach { key, value -> println("$key -> $value") }
}